window.addEventListener('load', function() {

    function $(Selector) {
        var dom = document.querySelectorAll(Selector);

        if (dom.length === 0) {
            return null;
        }

        if (dom === 1) {
            return dom[0];
        }

        return dom;
    }


    function getStyle(dom, attr) {
        return window.getComputedStyle(dom)[attr];
    }

    // 导航栏页面滚动事件
    window.addEventListener('scroll', function() {
        if (scrollY > 20) {
            $('.header_navbar')[0].style.backgroundColor = 'White';
            $('.nav-link').forEach(function(item) {
                item.style.color = 'black';
            });
            $('.logo img')[0].src = 'http://demo.mobanwang.com/mb/lo202301/202301033/html/assets/images/logo-2.svg';
        } else {
            $('.header_navbar')[0].style.backgroundColor = 'transparent';
            $('.nav-link').forEach(function(item) {
                item.style.color = 'white';
            });
            $('.logo img')[0].src = 'http://demo.mobanwang.com/mb/lo202301/202301033/html/assets/images/logo.svg';
        }

    })


    setTime($('.about_item'), 0, 200)
    setTime($('.about_item'), 1, 600)
    setTime($('.about_item'), 2, 1000)
    setTime($('.about_item'), 3, 1400)
    setTime($('#card_title'), 0, 200)
    setTime($('#card_text'), 0, 600)
    setTime($('#btn_'), 0, 1000)

    // setTime($('.pack_card'), 0, 400)
    // setTime($('.pack_card'), 1, 1200)
    // setTime($('.pack_card'), 2, 2000)
    // setTime($('.pack_card'), 3, 400)
    // setTime($('.pack_card'), 4, 1200)
    // setTime($('.pack_card'), 5, 2000)

    function setTime(dom, index, time) {
        setTimeout(function() {
            dom[index].style.visibility = 'visible';
        }, time)
    }
})